<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - binary_search_tree_mm1.cpp</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2003  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#ifndef</font> DLIB_BINARY_SEARCH_TREE_KERNEl_TEST_
<font color='#0000FF'>#define</font> DLIB_BINARY_SEARCH_TREE_KERNEl_TEST_


<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>sstream<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>string<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>cstdlib<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>ctime<font color='#5555FF'>&gt;</font>

<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>dlib<font color='#5555FF'>/</font>memory_manager_global.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>dlib<font color='#5555FF'>/</font>memory_manager_stateless.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>dlib<font color='#5555FF'>/</font>binary_search_tree.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='tester.h.html'>tester.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='binary_search_tree.h.html'>binary_search_tree.h</a>"

<font color='#0000FF'>namespace</font>  
<b>{</b>

    <font color='#0000FF'>class</font> <b><a name='binary_search_tree_tester'></a>binary_search_tree_tester</b> : <font color='#0000FF'>public</font> tester
    <b>{</b>
        <font color='#0000FF'>struct</font> <b><a name='factory'></a>factory</b>
        <b>{</b>
            <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>&gt;</font>
            <font color='#0000FF'>struct</font> <b><a name='return_type'></a>return_type</b> <b>{</b>
                <font color='#0000FF'>typedef</font> <font color='#0000FF'>typename</font> memory_manager<font color='#5555FF'>&lt;</font>U<font color='#5555FF'>&gt;</font>::kernel_1c type;
            <b>}</b>;

            <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> U<font color='#5555FF'>&gt;</font>
            <font color='#0000FF'>static</font> <font color='#0000FF'>typename</font> return_type<font color='#5555FF'>&lt;</font>U<font color='#5555FF'>&gt;</font>::type<font color='#5555FF'>*</font> <b><a name='get_instance'></a>get_instance</b> <font face='Lucida Console'>(</font>
            <font face='Lucida Console'>)</font>
            <b>{</b>
                <font color='#0000FF'>static</font> <font color='#0000FF'>typename</font> return_type<font color='#5555FF'>&lt;</font>U<font color='#5555FF'>&gt;</font>::type instance;
                <font color='#0000FF'>return</font> <font color='#5555FF'>&amp;</font>instance;
            <b>}</b>

        <b>}</b>;


    <font color='#0000FF'>public</font>:
        <b><a name='binary_search_tree_tester'></a>binary_search_tree_tester</b> <font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font> :
            tester <font face='Lucida Console'>(</font>"<font color='#CC0000'>test_binary_search_tree_mm1</font>",
                    "<font color='#CC0000'>Runs tests on the binary_search_tree component with memory managers.</font>"<font face='Lucida Console'>)</font>
        <b>{</b><b>}</b>

        <font color='#0000FF'><u>void</u></font> <b><a name='perform_test'></a>perform_test</b> <font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font>
        <b>{</b>
            dlog <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> LINFO <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>testing kernel_1a /w memory_manager_global</font>";
            binary_search_tree_kernel_test<font color='#5555FF'>&lt;</font>binary_search_tree<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>int</u></font>,<font color='#0000FF'><u>int</u></font>, 
            memory_manager_global<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>char</u></font>,factory<font color='#5555FF'>&gt;</font>::kernel_1a<font color='#5555FF'>&gt;</font>::kernel_1a<font color='#5555FF'>&gt;</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
            <font color='#BB00BB'>print_spinner</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;


            dlog <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> LINFO <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>testing kernel_1a /w memory_manager_stateless</font>";
            binary_search_tree_kernel_test<font color='#5555FF'>&lt;</font>binary_search_tree<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>int</u></font>,<font color='#0000FF'><u>int</u></font>, 
            memory_manager_stateless<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>char</u></font><font color='#5555FF'>&gt;</font>::kernel_1a<font color='#5555FF'>&gt;</font>::kernel_1a<font color='#5555FF'>&gt;</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
            <font color='#BB00BB'>print_spinner</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
        <b>}</b>
    <b>}</b> a;

<b>}</b>

<font color='#0000FF'>#endif</font>

</pre></body></html>